<template>
  <el-table-column :="attrs">
    <template v-if="$slots.header" #header>
        <slot name="header" />
    </template>
    <template v-if="$slots.default" #default="scope">
        <slot :row="scope.row" :index="scope.$index" :auths="auths" />
    </template>
  </el-table-column>
</template>

<script setup lang="ts">
import { useAttrs, computed } from 'vue'
import { useRoute } from 'vue-router'
const attrs = useAttrs()
const route = useRoute()

const auths = computed(() => {
  const auths: string[] = route.meta.auths as string[] || []
  return new Set(auths)
})
</script>
